<template>
  <div class="app-container">
    <!--<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch"
             label-width="68px">
      <el-form-item>
        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
&lt;!&ndash;        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>&ndash;&gt;
      </el-form-item>
    </el-form>-->
    <h2>入库数据统计</h2>
    <el-table border v-loading="loading" :data="dataList" ref="table" :max-height="tableMaxHeight">
      <el-table-column label="部门名称" align="center" prop="deptName"/>
<!--      <el-table-column label="统计模块" align="center" prop="category"/>-->
<!--      <el-table-column label="统计科目" align="center" prop="kind"/>-->
      <el-table-column label="昨日入库数量" align="center" prop="count1"/>
      <el-table-column label="昨日入库金额" width="120" align="center" prop="money1"/>
      <el-table-column label="当日入库数量" align="center" prop="count2"/>
      <el-table-column label="当日入库金额" width="120" align="center" prop="money2"/>
      <el-table-column label="本周入库数量" align="center" prop="count3"/>
      <el-table-column label="本周入库金额" width="120" align="center" prop="money3"/>
      <el-table-column label="本月入库数量" align="center" prop="count4"/>
      <el-table-column label="本月入库金额" width="120" align="center" prop="money4"/>
      <el-table-column label="本季度入库数量" align="center" prop="count5"/>
      <el-table-column label="本季度入库金额" width="120" align="center" prop="money5"/>
      <el-table-column label="本年入库数量" align="center" prop="count6"/>
      <el-table-column label="本年入库金额" width="120" align="center" prop="money6"/>
      <el-table-column label="本年入库条目数" align="center" prop="count7"/>
    </el-table>
  </div>
</template>

<script>
    import {deleteAction, getAction} from '@/api/manage'

    export default {
        name: "StatisticsForOrderIn",
        title: "入库数据统计",
        components: {
        },
        data() {
            return {
                // 遮罩层
                loading: true,
                // 选中数组
                ids: [],
                // 非单个禁用
                single: true,
                // 非多个禁用
                multiple: true,
                // 显示搜索条件
                showSearch: true,
                // 总条数
                total: 0,
                // 统计数据表格数据
                dataList: [],
                // 查询参数
                queryParams: {
                    pageNum: 1,
                    pageSize: 200,
                    deptId: null,
                    deptName: null,
                    userId: null,
                    userName: null,
                    category: "rktj",
                    kind: null,
                    type: null,
                    insertTime: null,
                    orderByColumn: "sort",
                    isAsc: "asc"
                },
                url: {
                    list: '/goodsStatistics/goodsStatistics/list',
                },
                tableMaxHeight: window.innerHeight - 320,
            };
        },
        created() {
            this.getList();
            window.addEventListener('resize', this.getTableHeight);
        },
        destroyed() {
            window.removeEventListener('resize', this.getTableHeight)
        },
        methods: {
            /** 搜索按钮操作 */
            handleQuery() {
                this.queryParams.pageNum = 1;
                this.getList();
            },
            /** 查询统计数据列表 */
            getList() {
                this.loading = true;
                getAction(this.url.list, this.queryParams).then(response => {
                    this.dataList = response.rows;
                    this.loading = false;
                });
            },
            getTableHeight() {
                this.tableHeight = window.innerHeight - 320
            },
        }
    };
</script>
<style scoped>
  h2{
    text-align: center;

  }
</style>
